/*
Autor: Alexander Savochkin, 2010
New BSD License
*/

#pragma once

#include <map>
#include <string>

#include "IRegulator.h"
#include "Config.h"


using std::map;
using std::string;

namespace SRCLF {
namespace Control {

	class RegulatorFactory
	{	
	public:
		virtual ~RegulatorFactory() {};
		virtual IRegulator* newInstance(const string& name, const Configuration& config) = 0;
	};


	template<class TRegulator>
	class DefaultRegulatorFactory : public RegulatorFactory
	{
	public:
		virtual IRegulator* newInstance(const string& name, const Configuration& config )
		{
			return new TRegulator(name, config);
		}
	};
} //namespace Control	
} //namespace SRCLF
